package com.zzvcom.utils.el;


public abstract class NumberFunction
{

    public static String randMoney(Object o) 
    {
             if(o!=null)
             {
                 String tmp=o.toString();
                 if(tmp.indexOf('.')>0)
                 {
                     try
                     {
                        double d= Double.valueOf(tmp);
                        long l=Long.valueOf(tmp.substring(0, tmp.lastIndexOf('.')));
                        if(d==l)
                        {
                            return l+"";
                        }
                        else
                        {
                            return tmp;
                        }
                     }
                     catch(Exception e)
                     {
                         e.printStackTrace();
                     }
                 }
                 else
                 {
                     return tmp;
                 }
                 
             }
             
             return "";
	}
    
    public static void main(String agrs[])
    {
        
        System.out.println(randMoney("3.00"));
        System.out.println(randMoney("3.44"));
    }

}
